package io.gitee.yxsnake.embark.web.core.base;

/**
 * @author snake
 * @description 响应码抽象接口
 * @since 2024/9/28 23:55
 */

public interface IResultCode {

    Integer getCode();

    String getMsg();

    default ErrorCode convert() {
        return ErrorCode.builder()
                .code(getCode())
                .msg(getMsg())
                .build();
    }


    default ErrorCode overrideMsg(String msg) {
        return ErrorCode.builder()
                .code(getCode())
                .msg(msg)
                .build();
    }
}
